package com.example.performance.config;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * HTTP性能压测工具配置属性类
 * 用于读取application.yml中的自定义配置
 */
@ConfigurationProperties(prefix = "performance.tester")
public class PerformanceTesterProperties {

    /**
     * 默认配置文件路径
     */
    private String defaultConfigPath = "config/example-config.yml";

    /**
     * Web界面配置
     */
    private Web web = new Web();

    /**
     * 报告配置
     */
    private Report report = new Report();

    public static class Web {
        /**
         * Web界面标题
         */
        private String title = "HTTP性能压测工具";

        /**
         * 是否启用CORS
         */
        private boolean enableCors = false;

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public boolean isEnableCors() {
            return enableCors;
        }

        public void setEnableCors(boolean enableCors) {
            this.enableCors = enableCors;
        }
    }

    public static class Report {
        /**
         * 报告输出目录
         */
        private String outputDir = "reports/";

        /**
         * 报告格式
         */
        private String format = "html";

        public String getOutputDir() {
            return outputDir;
        }

        public void setOutputDir(String outputDir) {
            this.outputDir = outputDir;
        }

        public String getFormat() {
            return format;
        }

        public void setFormat(String format) {
            this.format = format;
        }
    }

    public String getDefaultConfigPath() {
        return defaultConfigPath;
    }

    public void setDefaultConfigPath(String defaultConfigPath) {
        this.defaultConfigPath = defaultConfigPath;
    }

    public Web getWeb() {
        return web;
    }

    public void setWeb(Web web) {
        this.web = web;
    }

    public Report getReport() {
        return report;
    }

    public void setReport(Report report) {
        this.report = report;
    }
}